Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete node on machine deletion #809

Merged
merged 1 commit into from
Mar 11, 2019

Conversation

enxebre
Copy link
Member

@enxebre enxebre commented Mar 8, 2019

What this PR does / why we need it:
When running with no cloud controller manager orphan nodes remains forever.
This ensures that when deleting a machine the backed node (if any) is also deleted right away from the machine controller after the actuator succeed deleting the cloud instance, so no need to depend on the existence of a cloud manager to garbage collect the node

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

Special notes for your reviewer:

Please confirm that if this PR changes any image versions, then that's the sole change this PR makes.

Release note:


@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Mar 8, 2019
@k8s-ci-robot
Copy link
Contributor

Hi @enxebre. Thanks for your PR.

I'm waiting for a kubernetes-sigs or kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Mar 8, 2019
@gyliu513
Copy link
Contributor

gyliu513 commented Mar 8, 2019

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Mar 8, 2019
@enxebre
Copy link
Member Author

enxebre commented Mar 8, 2019

@vincepri @hardikdr @alvaroaleman can we think of any reason to not do this?

@alvaroaleman
Copy link
Member

@vincepri @hardikdr @alvaroaleman can we think of any reason to not do this?

I have some comments on the implementation but the only reason I can think of that would make this behaviour cause issues is if someone put a wrong nodeRef on a machine object. But if that happens this change makes it more obvious that there is a bug.

@enxebre
Copy link
Member Author

enxebre commented Mar 8, 2019

/test pull-cluster-api-make

1 similar comment
@enxebre
Copy link
Member Author

enxebre commented Mar 8, 2019

/test pull-cluster-api-make

pkg/controller/machine/controller.go Outdated Show resolved Hide resolved
pkg/controller/machine/controller.go Outdated Show resolved Hide resolved
@detiber
Copy link
Member

detiber commented Mar 8, 2019

@enxebre lgtm outside of the lint issue:

W0308 12:44:02.801] Target //:lint-full up-to-date:
W0308 12:44:02.802] bazel-bin/lint-full_script
W0308 12:44:02.803] bazel-bin/lint-full
W0308 12:44:02.806] INFO: Elapsed time: 38.682s, Critical Path: 7.91s
W0308 12:44:02.806] INFO: 362 processes: 362 linux-sandbox.
W0308 12:44:02.807] INFO: Build completed successfully, 369 total actions
W0308 12:44:02.818] INFO: Running command line: bazel-bin/lint-full run '--fast=false'
W0308 12:44:02.818] INFO: Build completed successfully, 369 total actions
I0308 12:44:11.262] pkg/controller/machine/controller.go:182: File is not `gofmt`-ed with `-s` (gofmt)
I0308 12:44:11.263] klog.Infof("Deleting node %q for machine %q", m.Status.NodeRef.Name, m.Name )
I0308 12:44:12.058] Makefile:82: recipe for target 'lint-full' failed
W0308 12:44:12.065] make: *** [lint-full] Error 1

Copy link
Member

@vincepri vincepri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor comment.

/approve

pkg/controller/machine/controller.go Outdated Show resolved Hide resolved
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: enxebre, vincepri

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 8, 2019
Copy link
Member

@hardikdr hardikdr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR. Looks good to me.

@detiber
Copy link
Member

detiber commented Mar 8, 2019

/milestone v1alpha1

@k8s-ci-robot k8s-ci-robot added this to the v1alpha1 milestone Mar 8, 2019
@vincepri
Copy link
Member

/assign @detiber

@detiber
Copy link
Member

detiber commented Mar 11, 2019

/lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants